// components/modal/modal.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title:{
      type:String,
      value:'在线预约'
    },
  
  },

  /**
   * 组件的初始数据
   */
  data: {
    isshowdialog:false,
    ismask:false,
    citys:[],
    index:-1
  },

  /**
   * 组件的方法列表
   */
  methods: {
  
    //隐藏弹框
    hideModal() {
      if (this.data.isshowdialog){
        this.setData({
          isshowdialog: !this.data.isshowdialog,
          ismask: !this.data.ismask
        })
      }
    },
    //展示弹框
    showModal() {
      if (!this.data.isshowdialog) {
        this.setData({
          isshowdialog: !this.data.isshowdialog,
          ismask: !this.data.ismask
        })
      }
    },
    hidemask(){
      this.triggerEvent("hideModal");
    },
    showmask(icon,msg){
      wx.showToast({
        title:msg,
        icon:icon
      })
    },
    formSubmit(e){
      console.log(e)
      this.triggerEvent("submitform", e.detail);
    },

    setparam(data){
      this.setData({
        citys:data
      })
    },

    bindCitysChange(e) {
      this.setData({
        index: e.detail.value
      })
    }
  }
})
